package cn.mw.cmdb.entity;

import cn.mw.cmdb.service.ServiceChoose;
import cn.mw.cmdb.service.impl.AssetsScanResultServiceImpl;
import cn.mw.cmdb.util.DataCreateInfo;
import cn.mw.components.mongodb.anno.AutoId;
import cn.mw.components.mongodb.anno.CMDBProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.ArrayList;
import java.util.List;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Document("mw_cmdbmd_assets_scan_result")
public class AssetsScanResultInfo extends DataAuth implements ServiceChoose, DataCreateInfo {

    public static final String PropertyMap = "properties";


    @Schema(description = "扫描资产id")
    @CMDBProperty(id = true, searchType = PropertyTypeString.ID, searchPrefix = "_")
    @AutoId
    private String id;

    @CMDBProperty
    private String scanRuleId;

    @CMDBProperty(searchType = PropertyTypeInt.ID)
    private int batchNo;

    @CMDBProperty
    private List<ScanResultSuccessInfo> successList = new ArrayList<>();

    @CMDBProperty
    private List<ScanResultFailInfo> failList = new ArrayList<>();

    @Override
    public String getServiceId() {
        return AssetsScanResultServiceImpl.ID;
    }

}
